package com.buanalintas.sandals.pos.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Kazao
 */
@Entity
@Table(name = "pos_transaction_barcode")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PosTransactionBarcode.findAll", query = "SELECT p FROM PosTransactionBarcode p"),
    @NamedQuery(name = "PosTransactionBarcode.findBySync", query = "SELECT p FROM PosTransactionBarcode p WHERE p.sync = :sync"),
    @NamedQuery(name = "PosTransactionBarcode.findByBarcodeId", query = "SELECT p FROM PosTransactionBarcode p WHERE p.barcodeId = :barcodeId"),
    @NamedQuery(name = "PosTransactionBarcode.findByBarcodeBarcode", query = "SELECT p FROM PosTransactionBarcode p WHERE p.barcodeBarcode = :barcodeBarcode"),
    @NamedQuery(name = "PosTransactionBarcode.findByBarcodeStatus", query = "SELECT p FROM PosTransactionBarcode p WHERE p.barcodeStatus = :barcodeStatus")})
public class PosTransactionBarcode implements Serializable {

    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "barcode_id")
    private Integer barcodeId;
    @Column(name = "barcode_barcode")
    private String barcodeBarcode;
    @Column(name = "barcode_status")
    private String barcodeStatus;
    @Column(name = "barcode_quantity")
    private Integer barcodeQuantity;
    @Lob
    @Column(name = "barcode_information")
    private String barcodeInformation;

    public PosTransactionBarcode() {
    }

    public PosTransactionBarcode(Integer barcodeId) {
        this.barcodeId = barcodeId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getBarcodeId() {
        return barcodeId;
    }

    public void setBarcodeId(Integer barcodeId) {
        this.barcodeId = barcodeId;
    }

    public String getBarcodeBarcode() {
        return barcodeBarcode;
    }

    public void setBarcodeBarcode(String barcodeBarcode) {
        this.barcodeBarcode = barcodeBarcode;
    }

    public String getBarcodeStatus() {
        return barcodeStatus;
    }

    public void setBarcodeStatus(String barcodeStatus) {
        this.barcodeStatus = barcodeStatus;
    }

    public Integer getBarcodeQuantity() {
        return barcodeQuantity;
    }

    public void setBarcodeQuantity(Integer barcodeQuantity) {
        this.barcodeQuantity = barcodeQuantity;
    }

    public String getBarcodeInformation() {
        return barcodeInformation;
    }

    public void setBarcodeInformation(String barcodeInformation) {
        this.barcodeInformation = barcodeInformation;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (barcodeId != null ? barcodeId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionBarcode)) {
            return false;
        }
        PosTransactionBarcode other = (PosTransactionBarcode) object;
        if ((this.barcodeId == null && other.barcodeId != null) || (this.barcodeId != null && !this.barcodeId.equals(other.barcodeId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.buanalintas.sandals.pos.entities.PosTransactionBarcode[ barcodeId=" + barcodeId + " ]";
    }
}
